//
//  ViewController.m
//  UIHomeWork05-相册轮播图
//
//  Created by tusm on 16/7/20.
//  Copyright © 2016年 tusm. All rights reserved.
//

#import "ViewController.h"
#import "Album.h"
#define  kWidth self.view.frame.size.width
#define  kHeight self.view.frame.size.height

@interface ViewController ()

@end

@implementation ViewController
//完善ScrollView相册, 实现轮播及缩放恢复。
//封装轮播图
//添加UIPageControl, 绑定事件, 有点击切换效果
//不用添加定时器
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self createAlbum];
}
- (void)createAlbum{

    NSMutableArray *mArr = [NSMutableArray array];
    for (int i = 1;i < 5; i ++) {
        UIImage *img = [UIImage imageNamed:[NSString stringWithFormat:@"guidePage_0%d",i]];
        [mArr addObject:img];
    }
    Album *album = [[Album alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight) images:mArr];
    album.center = self.view.center;
    [self.view addSubview:album];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
